package com.reading.service.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.reading.mapper.ClassificationMapper;
import com.reading.pojo.web.Classification;
import com.reading.service.ClassificationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ClassificationServiceImpl implements ClassificationService {
    @Autowired
    private ClassificationMapper classificationMapper;

    @Override
    public PageInfo findclassification(Classification classification, Integer pageNo, Integer pageSize) {
        PageHelper.startPage(pageNo,pageSize);
        List<Classification> list = classificationMapper.findclassification(classification);
        PageInfo pageInfo = new PageInfo<>(list);
        return pageInfo;
    }

    @Override
    public void add(Classification classification) {
        classificationMapper.add(classification);
    }

    @Override
    public void update(Classification classification) {
        classificationMapper.update(classification);
    }

    @Override
    public void delete(Integer id) {
        classificationMapper.delete(id);
    }
}
